/*
 * LJPlane.h
 *
 *  Created on: Mar 25, 2014
 *      Author: liu
 */

#ifndef LJPLANE_H_
#define LJPLANE_H_

namespace ljm {

template<typename T>
class LJPlane
{
public:
	LJVector3t<T> m_N;	// normalized normal vector
	T m_D;				// distance from origin to plane

public:
	LJPlane():m_D(T(0)){}
	LJPlane(const LJVector3t<T>& n, const T& d, bool normalized = false);
	~LJPlane(void){}
};

template<typename T>
LJPlane<T>::LJPlane(const LJVector3t<T>& n, const T& d, bool normalized = false)
{
	if(!normalized)
	{
		m_N = ljm::normalize(n);
		m_D = d;
	}
	else
	{
		m_N = n;
		m_D = d;
	}
}

}



#endif /* LJPLANE_H_ */
